<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Introduction
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora101.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora104.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Introduction</H2>The development of lexical analysis and parsing tools has been an
important area of research in computer science. This work has produced
the lexer and parser generators <TT>lex</TT> and <TT>yacc</TT> whose worthy
scions <TT>camllex</TT> and <TT>camlyacc</TT> are presented in this
chapter. These two tools are the de-facto standard for implementing
lexers and parsers, but there are other tools, like streams or the
regular expression library <TT>str</TT>, that may be adequate
for applications which do not need a powerful analysis.<BR>
<BR>
The need for such tools is especially acute in the area of
state-of-the-art programming languages, but other applications
can profit from such tools: for example, database systems offering the
possibility of issuing queries, or spreadsheets defining the contents
of cells as the result of the evaluation of a formula. More modestly,
it is common to use plain text files to store data; for example system
configuration files or spreadsheet data. Even in such limited cases,
processing the data involves some amount of lexical analysis and
parsing.<BR>
<BR>
In all of these examples the problem that
lexical analysis and parsing must solve is that of transforming a linear
character stream into a data item with a richer structure: a string of
words, a record structure, the abstract syntax tree for a program, etc.<BR>
<BR>
All languages have a set of vocabulary items (lexicon) and a grammar
describing how such items may be combined to form larger items
(syntax). For a computer or program to be able to correctly process a
language, it must obey precise lexical and syntactic rules. A computer
does not have the detailed semantic understanding required to resolve
ambiguities in natural language. To work around the limitation,
computer languages typically obey clearly stated rules without
exceptions. The lexical and syntactic structure of such languages has
received formal definitions that we briefly introduce in this chapter
before introducing their uses.<BR>
<BR>
<HR>
<A HREF="book-ora101.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora104.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
